package com.sh.caryr.erp.entity.enums;

import java.util.HashMap;
import java.util.Map;

public enum SalesPlatform {

    JING_DONG("jingdong", "京东"),
    TIAN_MAO("tianmao", "天猫");

    SalesPlatform(String val, String text) {
        this.val = val;
        this.text = text;
    }

    static Map<String, SalesPlatform> map = new HashMap<>();

    static {
        for (SalesPlatform p : SalesPlatform.values()) {
            map.put(p.getVal(), p);
        }
    }

    String val;
    String text;

    public String getVal() {
        return val;
    }

    public String getText() {
        return text;
    }

    public static SalesPlatform getEnum(String val) {
        return map.get(val);
    }

    public static boolean containsVal(String val) {
        return map.keySet().contains(val);
    }
}
